{% if is_paginated %}
  <div class="pagination" style="text-align: center">
    <ul>
      {% if page_obj.has_previous %}
        <li><a href="{% url page_view page_obj.previous_page_number %}">«</a></li>
      {% endif %}
      {% for p_number in paginator.page_range %}
        <li {% if p_number == page_obj.number %}class="active"{% endif %}><a href="{% url page_view p_number %}">{{ p_number }}</a></li>
      {% endfor %}
      {% if page_obj.has_next %}
        <li><a href="{% url page_view page_obj.next_page_number %}">»</a>
      {% endif %}
    </ul>
  </div>
{% endif %}